<template>
  <div>
    <div>name: {{ store.name }}</div>
    <div>count: {{ store.count }}</div>
    <div>double: {{ store.double }}</div>
    <button @click="changeCount">change count</button>
    <button @click="changeContent">change content</button>
    <button @click="handleStoreAction_ChangeCount">handleStoreAction</button>
  </div>
</template>

<script setup>
import useStore from './store'
const store = useStore()
console.log(useStore())
const changeCount = () => {
  store.count++
}
const changeContent = () => {
  store.$patch({
    name: 'xiaohei',
    count: 10
  })
}
const handleStoreAction_ChangeCount = async () => {
  await store.changeCount(100)
  console.log("111111")
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
